import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
   redirect: "/home",
    meta: { isShowNav:false,title:"不凡" }
  },
  {
    path: '/home',
    name: 'Home',
    meta: { isShowNav:false,title:"不凡" },
    component: ()=> import("../views/home/index.vue")
  },
  {
    path: '/project',
    name: 'Project',
    meta: { isShowNav:false,title:"不凡" },
    component: () => import( '../views/project/index.vue')
  },
  {
    path: '/divice',
    name: 'Divice',
    meta: { isShowNav:false,title:"不凡" },
    component: () => import( '../views/divice/index.vue')
  },
  {
    path: '/shopcar',
    name: 'Shopcar',
    meta: { isShowNav:false,title:"不凡" },
    component: () => import( '../views/shopcar/index.vue')
  },
  {
    path: '/mine',
    name: 'Mine',
    meta: { isShowNav:false,title:"不凡" },
    component: () => import( '../views/mine/index.vue')
  },
  //分类的主界面

  {
    
    path: '/categorylist/:id',
    name: 'HomeCategory',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/categorylist/index.vue')
  },
  {
    
    path: '/home/brandlist',
    name: 'HomeBrandlist',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/brandlist/index.vue')
  },
  {
    path: '/home/braanddetail/:id',
    name: 'HomeBrandDEetail',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/branddetail/index.vue')
  },
  {
    path: '/home/newgoods',
    name: 'newgoods',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/newgoods/index.vue')
  },
  {
    path: '/home/map',
    name: 'addmap',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/map/map.vue')
  },
  {
    path: '/home/goodsdetail/:id',
    name: 'GoodsDetail',
    meta: { isShowNav:true,title:"不凡" },
    component: () => import( '../views/home/goodsdetail/index.vue')
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
